<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FeedbackList.ascx.cs" Inherits="FeedbackList" %>

<script type="text/javascript">
    var the_url = "";
    function get_text() {
        the_url ="Default.aspx?ctrl=fbs&search="+ document.getElementById("txtSearch").value;
    }
</script>

<table>
    <tr>
        <td style="width: 137px">
            <asp:Label ID="Label1" runat="server" Text="Enter text to search:"></asp:Label></td>
        <td style="width: 100px">
            <input id="txtSearch"  type="text" /></td>
        <td style="width: 100px">
            <a class="c_button" onclick="get_text();" href="javascript:location=the_url">Search</a>
        </td>
    </tr>
</table>
    <ContentTemplate>
<asp:GridView CssClass="list_table" ID="dgrFeedback" runat="server" DataKeyNames="Id" AutoGenerateColumns="False" OnRowDeleting="dgrFeedback_RowDeleting">
    <Columns>
        <asp:TemplateField>            
            <ItemTemplate>
                <asp:CheckBox ID="chkChoice" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="BrieftContent">         
            <ItemTemplate>
                <a href='Default.aspx?ctrl=fb&id=<%#Eval("Id")%>'><%#Eval("Subject")%></a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Writer email">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("WriterEmail") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Bind("WriterEmail") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Created Date">          
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Date","{0:MMM-dd-yyyy}") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Is replied">           
            <ItemTemplate>
                <asp:CheckBox ID="chkIsReplied" runat="server" Enabled="false" Checked='<%# Bind("IsReplied") %>'></asp:CheckBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Is replied">           
            <ItemTemplate>
                <a href='Default.aspx?ctrl=fb&id=<%#Eval("Id")%>'>Details</a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
    </ContentTemplate>


<br />
&nbsp;
<asp:LinkButton ID="lnkSetStatus" runat="server" Visible="false" OnClick="lnkSetStatus_Click">Mark selected items as replied feedbacks</asp:LinkButton>
<asp:LinkButton ID="lnkDelete" runat="server" CssClass="lnkDelete" OnClick="lnkDelete_Click">Delete selected items</asp:LinkButton><br />
<asp:Label ID="lblPaging" runat="server"></asp:Label>
<script type="text/javascript" language="javascript">    
	window.location.hash="<%=ActiveAccording %>";
</script>